﻿<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
  xmlns:sw="clr-namespace:System.Windows;assembly=System.Windows"
  xmlns:c="clr-namespace:HomeUX.Controls"
  xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">

    <!-- string resources to work around some Silverlight bugs - see below -->
    <sys:String x:Key="SevenKeyCharacters">7&amp;</sys:String>
    <sys:String x:Key="QuoteKeyCharacters">'"</sys:String>
    <sys:String x:Key="CommaKeyCharacters">,&lt;</sys:String>
    <sys:String x:Key="PeriodKeyCharacters">.&gt;</sys:String>
    
    <!-- style designed for 2-line buttons -->
    <Style TargetType="TextBlock" x:Key="Squeeze2">
        <Setter Property="FontSize" Value="13" />
        <Setter Property="LineHeight" Value="17" />
        <Setter Property="LineStackingStrategy" Value="BlockLineHeight" />
    </Style>

    <Style TargetType="c:HomeIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Width" Value="20" />
        <Setter Property="Height" Value="20" />
        <Setter Property="Scale" Value="0.03" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:HomeIcon">
                    <Canvas>
                        <Canvas.RenderTransform>
                            <ScaleTransform x:Name="ScaleTransform" />
                        </Canvas.RenderTransform>
                        <Path Fill="#7E8000" Data="M 200,15 L 440,55 L 675,290 L 675,555 460,645" />
                        <Path Fill="#FEFE01" Data="M 200,15 L 460,290 L 460,645 L 15,585 L 15,275" />
                        <Path Stroke="Black" StrokeThickness="20" Data="M 200,15 L 440,55 L 675,290 L 675,555 460,645 L 460,645 L 15,585 L 15,275 Z" />
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:WaitIcon">
        <Setter Property="HorizontalAlignment" Value="Right" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:WaitIcon">
                    <Canvas Width="10" Height="15" UseLayoutRounding="False">
                        <Canvas.RenderTransform>
                            <ScaleTransform ScaleX="0.1" ScaleY="0.1" />
                        </Canvas.RenderTransform>
                        <Path StrokeThickness="5" Stroke="Green" Fill="#AFFFFFFF" Data="M 5,5 L 45,75 L 5,145 L 95,145 L 55,75 L 95,5 Z" />
                        <Path Fill="#FF00A000" Data="M 25,35 L 75,35 L 52,75 L 52,115 L 90,140 L 10,140 L 48,115 L 48,75 " />
                        <Line X1="5" X2="95" Y1="5" Y2="5" StrokeThickness="10" Stroke="Green" StrokeStartLineCap="Round" StrokeEndLineCap="Round" />
                        <Line X1="5" X2="95" Y1="145" Y2="145" StrokeThickness="10" Stroke="Green" StrokeStartLineCap="Round" StrokeEndLineCap="Round" />
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:WaitIcon2">
        <Setter Property="HorizontalAlignment" Value="Right" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:WaitIcon2">
                    <Canvas Width="10" Height="15" UseLayoutRounding="False">
                        <Canvas.RenderTransform>
                            <ScaleTransform ScaleX="0.1" ScaleY="0.1" />
                        </Canvas.RenderTransform>
                        <Path StrokeThickness="5" Stroke="Yellow" Fill="#AFFFFFFF" Data="M 5,5 L 45,75 L 5,145 L 95,145 L 55,75 L 95,5 Z" />
                        <Path Fill="#FFC0C000" Data="M 25,35 L 75,35 L 52,75 L 52,115 L 90,140 L 10,140 L 48,115 L 48,75 " />
                        <Line X1="5" X2="95" Y1="5" Y2="5" StrokeThickness="10" Stroke="Yellow" StrokeStartLineCap="Round" StrokeEndLineCap="Round" />
                        <Line X1="5" X2="95" Y1="145" Y2="145" StrokeThickness="10" Stroke="Yellow" StrokeStartLineCap="Round" StrokeEndLineCap="Round" />
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="Path" x:Key="UpDownArrow">
        <Setter Property="Fill" Value="#617584" />
    </Style>

    <Style TargetType="Path" x:Key="MediaControlSymbol">
        <Setter Property="Fill" Value="#303030" />
    </Style>

    <Style TargetType="c:LineUpIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:LineUpIcon">
                    <Path Data="M 9,0 l 9,14 l -5,0 l 0,16 l -8,0 l 0,-16 l -5,0 Z" Style="{StaticResource UpDownArrow}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:LineDownIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:LineDownIcon">
                    <Path Data="M 5,0 l 0,16 l -5,0 l 9,14 l 9,-14 l -5,0 l 0,-16 Z" Style="{StaticResource UpDownArrow}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:PageUpIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:PageUpIcon">
                    <Path Data="M 9,0 l 9,14 l -5,0 l 0,16 l -8,0 l 0,-16 l -5,0 Z M 30,0 l 9,14 l -5,0 l 0,16 l -8,0 l 0,-16 l -5,0 Z" Style="{StaticResource UpDownArrow}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:PageDownIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:PageDownIcon">
                    <Path Data="M 5,0 l 0,16 l -5,0 l 9,14 l 9,-14 l -5,0 l 0,-16 Z M 26,0 l 0,16 l -5,0 l 9,14 l 9,-14 l -5,0 l 0,-16 Z" Style="{StaticResource UpDownArrow}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="c:InformationIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:InformationIcon">
                    <Grid Width="22" Height="22">
                        <Canvas>
                            <Canvas.RenderTransform>
                                <ScaleTransform ScaleX="0.2" ScaleY="0.2" />
                            </Canvas.RenderTransform>
                            <Ellipse Width="100" Height="100" Fill="#5080E0" Stroke="#303030" StrokeThickness="4" StrokeLineJoin="Round" Margin="5,5,0,0" />
                            <TextBlock FontSize="90" FontFamily="Times New Roman" FontWeight="Bold" Text="i" Foreground="White" Canvas.Left="44" Canvas.Top="4" />
                        </Canvas>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:WarningIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:WarningIcon">
                    <Grid Width="22" Height="22">
                        <Canvas>
                            <Canvas.RenderTransform>
                                <ScaleTransform ScaleX="0.2" ScaleY="0.2" />
                            </Canvas.RenderTransform>
                            <Path Data="M 50,7 l -50,86 l 100,0 Z" Fill="Yellow" Stroke="Black" StrokeThickness="8" StrokeLineJoin="Round" Margin="5,5,0,0" />
                            <TextBlock FontSize="70" FontWeight="Bold" Text="!" Canvas.Left="40" Canvas.Top="12" />
                        </Canvas>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:PlayIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:PlayIcon">
                    <Grid>
                        <Path Data="M 0,0 l 20,10 l -20,10 z" Style="{StaticResource MediaControlSymbol}" HorizontalAlignment="Center" VerticalAlignment="Top" />
                        <TextBlock Text="Play" Margin="0,19,0,-8" HorizontalAlignment="Center" VerticalAlignment="Top" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:PauseIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:PauseIcon">
                    <Grid>
                        <Path Data="M 0,0 l 7,0 l 0,20 l -7,0 z M 11,0 l 7,0 l 0,20 l -7,0 z" Style="{StaticResource MediaControlSymbol}" HorizontalAlignment="Center" VerticalAlignment="Top" />
                        <TextBlock Text="Pause" Margin="0,19,0,-8" HorizontalAlignment="Center" VerticalAlignment="Top" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:StopIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:StopIcon">
                    <Grid>
                        <Path Data="M 0,0 l 20,0 l 0,20 l -20,0 z" Style="{StaticResource MediaControlSymbol}" HorizontalAlignment="Center" VerticalAlignment="Top" />
                        <TextBlock Text="Stop" Margin="0,19,0,-8" HorizontalAlignment="Center" VerticalAlignment="Top" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:FastForwardIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:FastForwardIcon">
                    <Grid>
                        <Path Data="M 0,0 l 12,10 l -12,10 z M 12,0 l 12,10 l -12,10 z" Style="{StaticResource MediaControlSymbol}" HorizontalAlignment="Center" VerticalAlignment="Top" />
                        <TextBlock Text="Fast Fwd" Margin="0,19,0,-8" HorizontalAlignment="Center" VerticalAlignment="Top" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:RewindIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:RewindIcon">
                    <Grid>
                        <Path Data="M 0,10 l 12,-10 l 0,20 z M 12,10 l 12,-10 l 0,20 z" Style="{StaticResource MediaControlSymbol}" HorizontalAlignment="Center" VerticalAlignment="Top" />
                        <TextBlock Text="Rewind" Margin="0,19,0,-8" HorizontalAlignment="Center" VerticalAlignment="Top" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:MaxFastForwardIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:MaxFastForwardIcon">
                    <Grid>
                        <Path Data="M 0,0 l 12,10 l -12,10 z M 12,0 l 12,10 l -12,10 z M 24,0 l 12,10 l -12,10 z" Style="{StaticResource MediaControlSymbol}" HorizontalAlignment="Center" VerticalAlignment="Top" />
                        <TextBlock Text="Max FF" Margin="0,19,0,-8" HorizontalAlignment="Center" VerticalAlignment="Top" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:MaxRewindIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:MaxRewindIcon">
                    <Grid>
                        <Path Data="M 0,10 l 12,-10 l 0,20 z M 12,10 l 12,-10 l 0,20 z M 24,10 l 12,-10 l 0,20 z" Style="{StaticResource MediaControlSymbol}" HorizontalAlignment="Center" VerticalAlignment="Top" />
                        <TextBlock Text="Max Rew" Margin="0,19,0,-8" HorizontalAlignment="Center" VerticalAlignment="Top" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="c:NextTrackIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:NextTrackIcon">
                    <Grid>
                        <Path Data="M 0,0 l 12,10 l -12,10 z M 12,0 l 7,0 l 0,20 l -7,0 z" Style="{StaticResource MediaControlSymbol}" HorizontalAlignment="Center" VerticalAlignment="Top" />
                        <TextBlock Text="Next" Margin="0,19,0,-8" HorizontalAlignment="Center" VerticalAlignment="Top" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:PreviousTrackIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:PreviousTrackIcon">
                    <Grid>
                        <Path Data="M 0,0 l 7,0 l 0,20 l -7,0 z M 7,10 l 12,-10 l 0,20 z" Style="{StaticResource MediaControlSymbol}" HorizontalAlignment="Center" VerticalAlignment="Top" />
                        <TextBlock Text="Previous" Margin="0,19,0,-8" HorizontalAlignment="Center" VerticalAlignment="Top" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:RecordIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:RecordIcon">
                    <Grid>
                        <Path Style="{StaticResource MediaControlSymbol}" Data="M 0,10 a 10,10 0 1 1 20,0 a 10,10 0 1 1 -20,0 z" HorizontalAlignment="Center" VerticalAlignment="Top" />
                        <TextBlock Text="Record" Margin="0,19,0,-8" HorizontalAlignment="Center" VerticalAlignment="Top" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:LeftArrowIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:LeftArrowIcon">
                    <Path Data="M 0,8 l 14,-8 l 0,6 l 16,0 l 0,4 l -16,0 l 0,6 z" Style="{StaticResource MediaControlSymbol}" HorizontalAlignment="Center" VerticalAlignment="Top" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:RightArrowIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:RightArrowIcon">
                    <Path Data="M 0,6 l 16,0 l 0,-6 l 14,8 l -14,8 l 0,-6 l -16,0 z" Style="{StaticResource MediaControlSymbol}" HorizontalAlignment="Center" VerticalAlignment="Top" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:UpArrowIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:UpArrowIcon">
                    <Path Data="M 8,0 l 8,14 l -6,0 l 0,16 l -4,0 l 0,-16 l -6,0 z" Style="{StaticResource MediaControlSymbol}" HorizontalAlignment="Center" VerticalAlignment="Top" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:DownArrowIcon">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:DownArrowIcon">
                    <Path Data="M 6,0 l 4,0 l 0,16 l 6,0 l -8,14 l -8,-14 l 6,0 z" Style="{StaticResource MediaControlSymbol}" HorizontalAlignment="Center" VerticalAlignment="Top" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:NoAlbumArtIcon">
        <Setter Property="IsTabStop" Value="False" />
		<Setter Property="Width" Value="200" />
		<Setter Property="Height" Value="200" />
		<Setter Property="Scale" Value="1.0" />
    	<Setter Property="Template">
    		<Setter.Value>
    			<ControlTemplate TargetType="c:NoAlbumArtIcon">
    				<Grid Background="White">
						<Grid.RenderTransform>
							<ScaleTransform x:Name="ScaleTransform" CenterX="100" CenterY="100" />
						</Grid.RenderTransform>
						<Border BorderBrush="Black" BorderThickness="1" />
    					<Grid HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2,3,0,0">
    						<Ellipse Fill="#DDDDDD" Height="21" HorizontalAlignment="Left" Margin="0,87.333,0,0" VerticalAlignment="Top" Width="33" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto">
    							<Ellipse.RenderTransform>
    								<TransformGroup>
    									<ScaleTransform/>
    									<SkewTransform/>
    									<RotateTransform Angle="-25.53"/>
    									<TranslateTransform/>
    								</TransformGroup>
    							</Ellipse.RenderTransform>
    						</Ellipse>
    						<Rectangle Fill="#DDDDDD" HorizontalAlignment="Left" Margin="29,13,0,0" Width="3" Height="81" VerticalAlignment="Top"/>
    						<Rectangle Fill="#DDDDDD" Margin="28.388,5.691,0,0" Height="10.521" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" HorizontalAlignment="Left" Width="62.056">
    							<Rectangle.RenderTransform>
    								<TransformGroup>
    									<ScaleTransform/>
    									<SkewTransform AngleX="-9"/>
    									<RotateTransform Angle="-11.068"/>
    									<TranslateTransform/>
    								</TransformGroup>
    							</Rectangle.RenderTransform>
    						</Rectangle>
    						<Ellipse Fill="#DDDDDD" Height="21" Margin="59,76.333,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" HorizontalAlignment="Left" Width="33">
    							<Ellipse.RenderTransform>
    								<TransformGroup>
    									<ScaleTransform/>
    									<SkewTransform/>
    									<RotateTransform Angle="-25.53"/>
    									<TranslateTransform/>
    								</TransformGroup>
    							</Ellipse.RenderTransform>
    						</Ellipse>
    						<Rectangle Fill="#DDDDDD" HorizontalAlignment="Left" Margin="88,0,0,0" Width="3" Height="83" VerticalAlignment="Top"/>
    					</Grid>

    					<Grid HorizontalAlignment="Center" VerticalAlignment="Center" Margin="-7,-4,0,0">
    						<Ellipse Fill="#A1ACB7" Height="21" HorizontalAlignment="Left" Margin="0,87.333,0,0" VerticalAlignment="Top" Width="33" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto">
    							<Ellipse.RenderTransform>
    								<TransformGroup>
    									<ScaleTransform/>
    									<SkewTransform/>
    									<RotateTransform Angle="-25.53"/>
    									<TranslateTransform/>
    								</TransformGroup>
    							</Ellipse.RenderTransform>
    						</Ellipse>
    						<Rectangle Fill="#A1ACB7" HorizontalAlignment="Left" Margin="29,13,0,0" Width="3" Height="81" VerticalAlignment="Top"/>
    						<Rectangle Fill="#A1ACB7" Margin="28.388,5.691,0,0" Height="10.521" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" HorizontalAlignment="Left" Width="62.056">
    							<Rectangle.RenderTransform>
    								<TransformGroup>
    									<ScaleTransform/>
    									<SkewTransform AngleX="-9"/>
    									<RotateTransform Angle="-11.068"/>
    									<TranslateTransform/>
    								</TransformGroup>
    							</Rectangle.RenderTransform>
    						</Rectangle>
    						<Ellipse Fill="#A1ACB7" Height="21" Margin="59,76.333,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" HorizontalAlignment="Left" Width="33">
    							<Ellipse.RenderTransform>
    								<TransformGroup>
    									<ScaleTransform/>
    									<SkewTransform/>
    									<RotateTransform Angle="-25.53"/>
    									<TranslateTransform/>
    								</TransformGroup>
    							</Ellipse.RenderTransform>
    						</Ellipse>
    						<Rectangle Fill="#A1ACB7" HorizontalAlignment="Left" Margin="88,0,0,0" Width="3" Height="83" VerticalAlignment="Top"/>
    					</Grid>
    				</Grid>
    			</ControlTemplate>
    		</Setter.Value>
    	</Setter>
    </Style>

    <Style TargetType="c:PolygonGlow">
        <Setter Property="GlowThickness" Value="10" />
        <Setter Property="GlowColor" Value="#FFFFFF80" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:PolygonGlow">
                    <Canvas x:Name="LayoutRoot" UseLayoutRounding="False" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:GripBlock">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:GripBlock">
                    <Grid x:Name="LayoutRoot">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Opacity" To=".45" />
                                    </Storyboard>
                                </VisualState>
							</VisualStateGroup>
                            <VisualStateGroup x:Name="LabelStates">
                                <VisualState x:Name="LabelHidden" />
                                <VisualState x:Name="LabelVisible">
                                    <Storyboard>
                                        <!-- -->
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LeftShape1" Storyboard.TargetProperty="Width">
											<DiscreteObjectKeyFrame KeyTime="0" Value="9" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LeftShape1" Storyboard.TargetProperty="HorizontalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Left" />
                                        </ObjectAnimationUsingKeyFrames>
										<!-- -->
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LeftShape2" Storyboard.TargetProperty="Width">
											<DiscreteObjectKeyFrame KeyTime="0" Value="9" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LeftShape2" Storyboard.TargetProperty="HorizontalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Left" />
                                        </ObjectAnimationUsingKeyFrames>
										<!-- -->
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LeftShape3" Storyboard.TargetProperty="Width">
											<DiscreteObjectKeyFrame KeyTime="0" Value="9" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LeftShape3" Storyboard.TargetProperty="HorizontalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Left" />
                                        </ObjectAnimationUsingKeyFrames>
										<!-- -->
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LeftShape4" Storyboard.TargetProperty="Width">
											<DiscreteObjectKeyFrame KeyTime="0" Value="9" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LeftShape4" Storyboard.TargetProperty="HorizontalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Left" />
                                        </ObjectAnimationUsingKeyFrames>
										<!-- -->
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LeftShape5" Storyboard.TargetProperty="Width">
											<DiscreteObjectKeyFrame KeyTime="0" Value="9" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LeftShape5" Storyboard.TargetProperty="HorizontalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Left" />
                                        </ObjectAnimationUsingKeyFrames>
										<!-- -->
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LeftShape6" Storyboard.TargetProperty="Width">
											<DiscreteObjectKeyFrame KeyTime="0" Value="9" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LeftShape6" Storyboard.TargetProperty="HorizontalAlignment">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Left" />
                                        </ObjectAnimationUsingKeyFrames>
										<!-- -->
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="RightShape1" Storyboard.TargetProperty="Width" To="9" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="RightShape2" Storyboard.TargetProperty="Width" To="9" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="RightShape3" Storyboard.TargetProperty="Width" To="9" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="RightShape4" Storyboard.TargetProperty="Width" To="9" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="RightShape5" Storyboard.TargetProperty="Width" To="9" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="RightShape6" Storyboard.TargetProperty="Width" To="9" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Grid.Resources>
                                <Style x:Key="DarkGroove" TargetType="Rectangle">
                                    <Setter Property="VerticalAlignment" Value="Top" />
                                    <Setter Property="Height" Value="2" />
                                    <Setter Property="Fill">
                                        <Setter.Value>
                                            <LinearGradientBrush>
                                                <GradientStop Offset="0" Color="#80000000" />
                                                <GradientStop Offset="1" Color="#30000000" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                                <Style x:Key="LightGroove" TargetType="Rectangle">
                                    <Setter Property="VerticalAlignment" Value="Top" />
                                    <Setter Property="Height" Value="2" />
                                    <Setter Property="Margin" Value="0,2,0,0" />
                                    <Setter Property="Fill">
                                        <Setter.Value>
                                            <LinearGradientBrush>
                                                <GradientStop Offset="0" Color="#FFFFFFFF" />
                                                <GradientStop Offset="1" Color="#A0FFFFFF" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </Grid.Resources>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="4" />
                                <RowDefinition Height="2*" />
                                <RowDefinition Height="4" />
                                <RowDefinition Height="2*" />
                                <RowDefinition Height="4" />
                                <RowDefinition Height="2*" />
                                <RowDefinition Height="4" />
                                <RowDefinition Height="2*" />
                                <RowDefinition Height="4" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Rectangle Grid.Row="1" Style="{StaticResource DarkGroove}" />
                            <Rectangle Grid.Row="1" Style="{StaticResource LightGroove}" />
                            <Rectangle x:Name="LeftShape1" Grid.Row="3" Style="{StaticResource DarkGroove}" />
                            <Rectangle x:Name="LeftShape2" Grid.Row="3" Style="{StaticResource LightGroove}" />
                            <Rectangle x:Name="RightShape1" Grid.Row="3" Style="{StaticResource DarkGroove}" Width="0" HorizontalAlignment="Right" />
                            <Rectangle x:Name="RightShape2" Grid.Row="3" Style="{StaticResource LightGroove}" Width="0" HorizontalAlignment="Right" />
                            <Rectangle x:Name="LeftShape3" Grid.Row="5" Style="{StaticResource DarkGroove}" />
                            <Rectangle x:Name="LeftShape4" Grid.Row="5" Style="{StaticResource LightGroove}" />
                            <Rectangle x:Name="RightShape3" Grid.Row="5" Style="{StaticResource DarkGroove}" Width="0" HorizontalAlignment="Right" />
                            <Rectangle x:Name="RightShape4" Grid.Row="5" Style="{StaticResource LightGroove}" Width="0" HorizontalAlignment="Right" />
                            <Rectangle x:Name="LeftShape5" Grid.Row="7" Style="{StaticResource DarkGroove}" />
                            <Rectangle x:Name="LeftShape6" Grid.Row="7" Style="{StaticResource LightGroove}" />
                            <Rectangle x:Name="RightShape5" Grid.Row="7" Style="{StaticResource DarkGroove}" Width="0" HorizontalAlignment="Right" />
                            <Rectangle x:Name="RightShape6" Grid.Row="7" Style="{StaticResource LightGroove}" Width="0" HorizontalAlignment="Right" />
                            <Rectangle Grid.Row="9" Style="{StaticResource DarkGroove}" />
                            <Rectangle Grid.Row="9" Style="{StaticResource LightGroove}" />
                        </Grid>
                        <TextBlock x:Name="LabelTextBlock" FontSize="30" Foreground="#7A7A6D" TextAlignment="Center" VerticalAlignment="Center" LineStackingStrategy="BlockLineHeight" LineHeight="40" Text="{TemplateBinding Label}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:Shadow">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="ShadowOverhang" Value="12" />
        <Setter Property="ShadowUnderhang" Value="0" />
        <Setter Property="ShadowDarkness" Value="1" />
        <Setter Property="ShadowDepth" Value="12" />
        <Setter Property="ShadowCornerRadius" Value="5" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:Shadow">
                    <Grid x:Name="LayoutRoot">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition x:Name="ShadowRightColumn" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition x:Name="ShadowBottomRow" />
                        </Grid.RowDefinitions>
						<Grid x:Name="ShadowParent" Grid.ColumnSpan="2" Grid.RowSpan="2" UseLayoutRounding="False">
							<Rectangle Margin="0" Fill="#02000000" RadiusX="{TemplateBinding ShadowCornerRadius}" RadiusY="{TemplateBinding ShadowCornerRadius}" />
							<Rectangle Margin="1" Fill="#02000000" RadiusX="{TemplateBinding ShadowCornerRadius}" RadiusY="{TemplateBinding ShadowCornerRadius}" />
							<Rectangle Margin="2" Fill="#05000000" RadiusX="{TemplateBinding ShadowCornerRadius}" RadiusY="{TemplateBinding ShadowCornerRadius}" />
							<Rectangle Margin="3" Fill="#08000000" RadiusX="{TemplateBinding ShadowCornerRadius}" RadiusY="{TemplateBinding ShadowCornerRadius}" />
							<Rectangle Margin="4" Fill="#0C000000" RadiusX="{TemplateBinding ShadowCornerRadius}" RadiusY="{TemplateBinding ShadowCornerRadius}" />
							<Rectangle Margin="5" Fill="#0E000000" RadiusX="{TemplateBinding ShadowCornerRadius}" RadiusY="{TemplateBinding ShadowCornerRadius}" />
							<Rectangle Margin="6" Fill="#10000000" RadiusX="{TemplateBinding ShadowCornerRadius}" RadiusY="{TemplateBinding ShadowCornerRadius}" />
							<Rectangle Margin="7" Fill="#0E000000" RadiusX="{TemplateBinding ShadowCornerRadius}" RadiusY="{TemplateBinding ShadowCornerRadius}" />
							<Rectangle Margin="8" Fill="#0C000000" RadiusX="{TemplateBinding ShadowCornerRadius}" RadiusY="{TemplateBinding ShadowCornerRadius}" />
							<Rectangle Margin="9" Fill="#08000000" RadiusX="{TemplateBinding ShadowCornerRadius}" RadiusY="{TemplateBinding ShadowCornerRadius}" />
							<Rectangle Margin="10" Fill="#05000000" RadiusX="{TemplateBinding ShadowCornerRadius}" RadiusY="{TemplateBinding ShadowCornerRadius}" />
							<Rectangle Margin="11" Fill="#02000000" RadiusX="{TemplateBinding ShadowCornerRadius}" RadiusY="{TemplateBinding ShadowCornerRadius}" />
						</Grid>
                        <ContentPresenter x:Name="ContentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding BorderThickness}"  />
					</Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:TouchButton">
        <Setter Property="Width" Value="50" />
        <Setter Property="Height" Value="50" />
        <Setter Property="FontSize" Value="13" />
        <Setter Property="Padding" Value="4,0,4,0" />
        <Setter Property="Background" Value="#FF1F3B53" />
        <Setter Property="Foreground" Value="#FF000000" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="ClickMode" Value="Press" />
        <Setter Property="LitBackground" Value="Yellow" />
        <Setter Property="TextStyle">
            <Setter.Value>
                <Style TargetType="TextBlock">
                    <Setter Property="FontSize" Value="13" />
                    <Setter Property="LineStackingStrategy" Value="BlockLineHeight" />
                    <Setter Property="LineHeight" Value="15" />
                    <Setter Property="TextWrapping" Value="Wrap" />
                    <Setter Property="TextAlignment" Value="Center" />
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFA3AEB9" Offset="0" />
                    <GradientStop Color="#FF8399A9" Offset="0.375" />
                    <GradientStop Color="#FF718597" Offset="0.375" />
                    <GradientStop Color="#FF617584" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:TouchButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverVisualElement" Storyboard.TargetProperty="Opacity" To="1" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ColorAnimation Duration="0" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" To="#FF6DBDD1" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity" To="1" />
                                        <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" To="#D8FFFFFF" />
                                        <ColorAnimation Duration="0" Storyboard.TargetName="LitBackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" To="#C0FFFFFF" />
                                        <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" To="#C6FFFFFF" />
                                        <ColorAnimation Duration="0" Storyboard.TargetName="LitBackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" To="#70FFFFFF" />
                                        <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" To="#8CFFFFFF" />
                                        <ColorAnimation Duration="0" Storyboard.TargetName="LitBackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" To="#00FFFFFF" />
                                        <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" To="#3FFFFFFF" />
                                        <ColorAnimation Duration="0" Storyboard.TargetName="LitBackgroundGradient" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" To="#00FFFFFF" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity" To=".55" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity" To="1" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="PseudofocusStates">
                                <VisualState x:Name="Pseudofocused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="PseudofocusVisualElement" Storyboard.TargetProperty="Opacity" To="1" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pseudounfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="LitStates">
                                <VisualState x:Name="Unlit" />
                                <VisualState x:Name="Lit">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="LitBackgroundAnimation" Storyboard.TargetProperty="Opacity" To="1" />
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LitBackgroundGradient" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="WaitingStates">
                                <VisualState x:Name="Idle" />
                                <VisualState x:Name="Waiting">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="WaitIcon" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background" CornerRadius="3" Background="White" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" >
                            <Grid Background="{TemplateBinding Background}" Margin="1">
                                <Border Opacity="0" x:Name="BackgroundAnimation" Background="#FF448DCA" />
                                <Border Opacity="0" x:Name="LitBackgroundAnimation" Background="{TemplateBinding LitBackground}" />
                                <Rectangle Visibility="Visible" x:Name="BackgroundGradient">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush StartPoint=".7,0" EndPoint=".7,1">
                                            <GradientStop Color="#FFFFFFFF" Offset="0" />
                                            <GradientStop Color="#F9FFFFFF" Offset="0.375" />
                                            <GradientStop Color="#E5FFFFFF" Offset="0.625" />
                                            <GradientStop Color="#C6FFFFFF" Offset="1" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <Rectangle Visibility="Collapsed" x:Name="LitBackgroundGradient">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush StartPoint=".7,0" EndPoint=".7,1">
                                            <GradientStop Color="#FFFFFFFF" Offset="0" />
                                            <GradientStop Color="#9FFFFFFF" Offset="0.375" />
                                            <GradientStop Color="#66FFFFFF" Offset="0.625" />
                                            <GradientStop Color="#00FFFFFF" Offset="1" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Grid>
                        </Border>
                        <!--
                        <StackPanel Orientation="Vertical" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}">
                            <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                        </StackPanel>
                        -->
                        <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"  />
                        <TextBlock Style="{TemplateBinding TextStyle}" Text="{TemplateBinding Text}"  VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}"/>
                        
                        <Rectangle x:Name="FocusVisualElement" RadiusX="2" RadiusY="2" Margin="1" Stroke="#6DBDD1" StrokeThickness="2" Opacity="0" IsHitTestVisible="False"  />
                        <Rectangle x:Name="PseudofocusVisualElement" RadiusX="2" RadiusY="2" Margin="1" Stroke="#6DBDD1" StrokeThickness="2" Opacity="0" IsHitTestVisible="False"  />
                        <Rectangle x:Name="MouseOverVisualElement" RadiusX="2" RadiusY="2" Margin="1" Stroke="#80BCC3D8" StrokeThickness="2" Opacity="0" IsHitTestVisible="False"  />
                        <c:WaitIcon x:Name="WaitIcon" Margin="0,-1,-1,0" Visibility="Collapsed" />
                        <Rectangle x:Name="DisabledVisualElement" RadiusX="3" RadiusY="3" Fill="#FFFFFFFF" Opacity="0" IsHitTestVisible="False"  />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:TouchKeyboardCharacterButton" >
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:TouchKeyboardCharacterButton">
                    <c:TouchButton x:Name="InnerButton" FontSize="16" MinWidth="50" Width="{TemplateBinding Width}" HorizontalContentAlignment="Left" Padding="8,0,0,0" IsTabStop="False">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ShiftStates" >
                                <VisualState x:Name="Unshifted" />
                                <VisualState x:Name="Shifted">
                                    <Storyboard>
                                        <ColorAnimation Duration="0" Storyboard.TargetName="ShiftedLabel" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" To="Black" />
                                        <ColorAnimation Duration="0" Storyboard.TargetName="UnshiftedLabel" Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" To="Gray" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <StackPanel HorizontalAlignment="Left">
                            <TextBlock x:Name="ShiftedLabel" FontSize="16" LineHeight="18" LineStackingStrategy="BlockLineHeight" Margin="0,0,0,2" Foreground="Gray" />
                            <TextBlock x:Name="UnshiftedLabel" FontSize="16" LineHeight="18" LineStackingStrategy="BlockLineHeight" />
                        </StackPanel>
                    </c:TouchButton>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="TextBlock" x:Key="BigText">
        <Setter Property="FontSize" Value="16" />
    </Style>

    <Style TargetType="c:TouchKeyboard" >
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:TouchKeyboard">
                    <Grid x:Name="LayoutRoot">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates" >
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DisabledHelpText" Storyboard.TargetProperty="Visibility">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Opacity" To=".55" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DisabledHelpStates" >
                                <VisualState x:Name="ShowDisabledHelp">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames  Storyboard.TargetName="DisabledHelpText" Storyboard.TargetProperty="Opacity">
                                            <LinearDoubleKeyFrame KeyTime="0:0:0.3" Value="1" />
                                            <LinearDoubleKeyFrame KeyTime="0:0:4" Value="1" />
                                            <LinearDoubleKeyFrame KeyTime="0:0:4.3" Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <!--<DoubleAnimation Duration="0:0:0.3" Storyboard.TargetName="DisabledHelpText" Storyboard.TargetProperty="Opacity" To="1" />-->
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="HideDisabledHelp" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Vertical">
                            <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
                                <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Vertical">
                                    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
                                        <c:TouchKeyboardCharacterButton Characters="`~" />
                                        <c:TouchKeyboardCharacterButton Characters="1!" />
                                        <c:TouchKeyboardCharacterButton Characters="2@" />
                                        <c:TouchKeyboardCharacterButton Characters="3#" />
                                        <c:TouchKeyboardCharacterButton Characters="4$" />
                                        <c:TouchKeyboardCharacterButton Characters="5%" />
                                        <c:TouchKeyboardCharacterButton Characters="6^" />
                                        <c:TouchKeyboardCharacterButton Characters="{StaticResource SevenKeyCharacters}" /> <!-- Silverlight bug workaround: "&amp;" not supported within a property -->
                                        <c:TouchKeyboardCharacterButton Characters="8*" />
                                        <c:TouchKeyboardCharacterButton Characters="9(" />
                                        <c:TouchKeyboardCharacterButton Characters="0)" />
                                        <c:TouchKeyboardCharacterButton Characters="-_" />
                                        <c:TouchKeyboardCharacterButton Characters="=+" />
                                        <c:TouchButton x:Name="BackspaceButton" Width="100" IsTabStop="False">
                                            <TextBlock><Run FontFamily="Resources/Symbol.ttf#Symbol" Text="¬"/><Run Text="Backspace"/></TextBlock>
                                        </c:TouchButton>
                                    </StackPanel>
                                    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
                                        <c:TouchButton x:Name="TabButton" Width="75" Content="Tab" IsTabStop="False" />
                                        <c:TouchKeyboardCharacterButton Characters="Q" />
                                        <c:TouchKeyboardCharacterButton Characters="W" />
                                        <c:TouchKeyboardCharacterButton Characters="E" />
                                        <c:TouchKeyboardCharacterButton Characters="R" />
                                        <c:TouchKeyboardCharacterButton Characters="T" />
                                        <c:TouchKeyboardCharacterButton Characters="Y" />
                                        <c:TouchKeyboardCharacterButton Characters="U" />
                                        <c:TouchKeyboardCharacterButton Characters="I" />
                                        <c:TouchKeyboardCharacterButton Characters="O" />
                                        <c:TouchKeyboardCharacterButton Characters="P" />
                                        <c:TouchKeyboardCharacterButton Characters="[{" /><!-- {} means "escape the following" -->
                                        <c:TouchKeyboardCharacterButton Characters="]}" />
                                        <c:TouchKeyboardCharacterButton Characters="\|" Width="75" />
                                    </StackPanel>
                                    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
                                        <c:TouchButton x:Name="CapsLockButton" Width="87.5" Content="Caps Lock" IsTabStop="False" />
                                        <c:TouchKeyboardCharacterButton Characters="A" />
                                        <c:TouchKeyboardCharacterButton Characters="S" />
                                        <c:TouchKeyboardCharacterButton Characters="D" />
                                        <c:TouchKeyboardCharacterButton Characters="F" />
                                        <c:TouchKeyboardCharacterButton Characters="G" />
                                        <c:TouchKeyboardCharacterButton Characters="H" />
                                        <c:TouchKeyboardCharacterButton Characters="J" />
                                        <c:TouchKeyboardCharacterButton Characters="K" />
                                        <c:TouchKeyboardCharacterButton Characters="L" />
                                        <c:TouchKeyboardCharacterButton Characters=";:" />
                                        <c:TouchKeyboardCharacterButton Characters="{StaticResource QuoteKeyCharacters}" /> <!-- Silverlight bug workaround: "&quot;" not supported within a property -->
                                        <c:TouchButton x:Name="EnterButton" Content="Enter" Width="112.5" IsTabStop="False" />
                                    </StackPanel>
                                    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
                                        <c:TouchButton x:Name="LeftShiftButton" Width="112.5" Content="Shift" IsTabStop="False" />
                                        <c:TouchKeyboardCharacterButton Characters="Z" />
                                        <c:TouchKeyboardCharacterButton Characters="X" />
                                        <c:TouchKeyboardCharacterButton Characters="C" />
                                        <c:TouchKeyboardCharacterButton Characters="V" />
                                        <c:TouchKeyboardCharacterButton Characters="B" />
                                        <c:TouchKeyboardCharacterButton Characters="N" />
                                        <c:TouchKeyboardCharacterButton Characters="M" />
                                        <c:TouchKeyboardCharacterButton Characters="{StaticResource CommaKeyCharacters}" /> <!-- Silverlight bug workaround: "&lt;" not supported within a property -->
                                        <c:TouchKeyboardCharacterButton Characters="{StaticResource PeriodKeyCharacters}" /> <!-- Silverlight bug workaround: "&gt;" not supported within a property -->
                                        <c:TouchKeyboardCharacterButton Characters="/?" />
                                        <c:TouchButton x:Name="RightShiftButton" Width="137.5" Content="Shift" IsTabStop="False" />
                                    </StackPanel>
                                    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
                                        <Rectangle Width="187.5" />
                                        <c:TouchButton x:Name="SpaceButton" Width="300" Content="Space" IsTabStop="False" />
                                        <Rectangle Width="12.5" />
                                        <c:TouchButton x:Name="DeleteButton" Content="Delete" IsTabStop="False" />
                                        <c:TouchButton x:Name="HomeButton" Content="Home" IsTabStop="False" />
                                        <c:TouchButton x:Name="LeftArrowButton" IsTabStop="False">
                                        	<TextBlock Style="{StaticResource BigText}" FontFamily="Resources/Symbol.ttf#Symbol"><Run Text="¬"/></TextBlock>
                                        </c:TouchButton>
                                        <c:TouchButton x:Name="RightArrowButton" IsTabStop="False">
                                        	<TextBlock Style="{StaticResource BigText}" FontFamily="Resources/Symbol.ttf#Symbol"><Run Text="®"/></TextBlock>
                                        </c:TouchButton>
                                        <c:TouchButton x:Name="EndButton" Content="End" IsTabStop="False" />
                                    </StackPanel>
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>
                        <Rectangle x:Name="DisabledVisualElement" Visibility="Collapsed" Fill="Transparent" IsHitTestVisible="true" />
                        <Border x:Name="DisabledHelpText" Visibility="Collapsed" Background="White" Opacity="0" IsHitTestVisible="False" Padding="6" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <TextBlock FontSize="16" Foreground="Red"><Run Text="No text box is currently selected"/></TextBlock>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:TouchField">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:TouchField">
                    <Grid x:Name="LayoutRoot" Height="50">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity" To=".55" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Label" Storyboard.TargetProperty="Opacity" To=".55" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates" >
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Focus1" Storyboard.TargetProperty="(Border.BorderThickness)">
											<DiscreteObjectKeyFrame KeyTime="0" Value="1" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Focus2" Storyboard.TargetProperty="(Ellipse.StrokeThickness)">
											<DiscreteObjectKeyFrame KeyTime="0" Value="1" />
                                        </ObjectAnimationUsingKeyFrames>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
                            <VisualStateGroup x:Name="LitStates">
                                <VisualState x:Name="Unlit" />
                                <VisualState x:Name="Lit">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Lit1" Storyboard.TargetProperty="(Ellipse.Visibility)">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Lit2" Storyboard.TargetProperty="(Ellipse.Visibility)">
											<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
							</VisualStateGroup>
                            <VisualStateGroup x:Name="WaitingStates">
                                <VisualState x:Name="Idle" />
                                <VisualState x:Name="Waiting">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="WaitIcon" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="46" />
                        </Grid.ColumnDefinitions>
                        <Grid x:Name="LabelParent">
                            <TextBlock x:Name="Label" FontSize="13" />
                        </Grid>
                        <Border BorderThickness="1" Margin="0,19,-23,4">
                            <Border.BorderBrush>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFA3AEB9" Offset="0" />
                                    <GradientStop Color="#FF8399A9" Offset="0.375" />
                                    <GradientStop Color="#FF718597" Offset="0.375" />
                                    <GradientStop Color="#FF617584" Offset="1" />
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                        </Border>
                        <Ellipse Grid.Column="1" Margin="0,3,0,1">
                            <Ellipse.Stroke>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFA3AEB9" Offset="0" />
                                    <GradientStop Color="#FF8399A9" Offset="0.375" />
                                    <GradientStop Color="#FF718597" Offset="0.375" />
                                    <GradientStop Color="#FF617584" Offset="1" />
                                </LinearGradientBrush>
                            </Ellipse.Stroke>
                        </Ellipse>
                        <Rectangle Fill="White" Margin="1,20,-23,5" />
                        <Border x:Name="Focus1" Margin="1,20,-23,5" BorderBrush="#FF99C1E2" BorderThickness="0"/>
                        <Ellipse x:Name="Focus2" Grid.Column="1" Margin="1,4,1,2" Fill="White" Stroke="#FF99C1E2" StrokeThickness="0" />
                        <Rectangle Fill="White" Margin="2,21,-23,6" />
                        <Ellipse Grid.Column="1" Margin="3,6,3,4">
                            <Ellipse.Fill>
                                <LinearGradientBrush StartPoint=".7,0" EndPoint=".7,1">
                                    <GradientStop Color="#FFFFFFFF" Offset="0" />
                                    <GradientStop Color="#FFF9FAFB" Offset="0.375" />
                                    <GradientStop Color="#FFE8EBED" Offset="0.625" />
                                    <GradientStop Color="#FFCDD3D8" Offset="1" />
                                </LinearGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>                        
                        <Ellipse x:Name="Lit1" Grid.Column="1" Margin="3,6,3,4" Fill="Yellow" Visibility="Collapsed" />
                        <Ellipse x:Name="Lit2" Grid.Column="1" Margin="3,6,3,4" Visibility="Collapsed">
                            <Ellipse.Fill>
                                <LinearGradientBrush StartPoint=".5,0" EndPoint=".5,1">
                                    <GradientStop Color="#FFFFFFFF" Offset="0" />
                                    <GradientStop Color="#9FFFFFFF" Offset="0.375" />
                                    <GradientStop Color="#66FFFFFF" Offset="0.625" />
                                    <GradientStop Color="#00FFFFFF" Offset="1" />
                                </LinearGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>
                        <Canvas Grid.Column="1" Margin="13.5,22,0,0" UseLayoutRounding="False">
                            <!-- downward triangle -->
                            <Path Data="M 0,0 l 20,0 l -10,10 Z">
                                <Path.Fill>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                        <GradientStop Offset="0" Color="#00000020"/>
                                        <GradientStop Offset="1" Color="#20000020" />
                                    </LinearGradientBrush>
                                </Path.Fill>
                            </Path>
                            <Path Fill="#A0000020" Data="M 0,0 L 20,0 L 18,1 L 1,1" /><!-- #40000020 -->
                            <Path Fill="#FFFFFFFF" Data="M 20,0 L 10,10 L 10,9 L 17,1" /><!-- #E0FFFFFF -->
                            <Path Fill="#80000020" Data="M 10,9 L 10,10 L 0,0 L 2,1" /><!-- #30000020 -->
                        </Canvas>
                        <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" VerticalAlignment="Bottom" Margin="4,23,-2,8"  />
                        <c:WaitIcon x:Name="WaitIcon" Grid.Column="2" Visibility="Collapsed" />
                        <Grid x:Name="DisabledVisualElement" Grid.ColumnSpan="2" Height="50" Opacity="0" IsHitTestVisible="False">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*" />
								<ColumnDefinition Width="46" />
							</Grid.ColumnDefinitions>
							<Border BorderThickness="1" BorderBrush="White" Margin="0,19,-23,4" Background="White" />
							<Ellipse Grid.Column="1" Margin="-1,2,-1,0" Fill="White" />
						</Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:TouchTextBox">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:TouchTextBox">
                    <Grid x:Name="LayoutRoot">
                        <c:TouchField x:Name="TouchField" Label="{TemplateBinding Label}">
                            <TextBox x:Name="InnerTextBox" VerticalAlignment="Bottom" BorderThickness="0" FontSize="13">
                                <TextBox.Template>
                                    <ControlTemplate TargetType="TextBox">
                                        <Grid x:Name="RootElement" >
                                            <VisualStateManager.VisualStateGroups>
                                                <VisualStateGroup x:Name="CommonStates">
                                                    <VisualState x:Name="Normal" />
                                                    <VisualState x:Name="MouseOver" />
                                                    <VisualState x:Name="Disabled" />
                                                    <VisualState x:Name="ReadOnly" />
                                                </VisualStateGroup>
                                                <VisualStateGroup x:Name="FocusStates">
                                                    <VisualState x:Name="Focused" />
                                                    <VisualState x:Name="Unfocused" />
                                                </VisualStateGroup>
                                            </VisualStateManager.VisualStateGroups>
                                            <Border x:Name="Border">
                                                <Grid Background="White">
                                                    <Border x:Name="ReadOnlyVisualElement" />
                                                    <Border x:Name="MouseOverBorder">
                                                        <ScrollViewer x:Name="ContentElement" Padding="0" BorderThickness="0" IsTabStop="False" />
                                                    </Border>
                                                </Grid>
                                            </Border>
                                            <Border x:Name="DisabledVisualElement" />
                                            <Border x:Name="FocusVisualElement" />
                                        </Grid>
                                    </ControlTemplate>
                                </TextBox.Template>
                            </TextBox>
                        </c:TouchField>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:TouchMessageBox">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:TouchMessageBox">
                    <Grid x:Name="LayoutRoot">
                        <Border BorderBrush="Black" Background="White" BorderThickness="1" Padding="8"> 
                            <StackPanel>
                                <TextBlock x:Name="Message" Text="{TemplateBinding Message}" FontSize="13" TextWrapping="Wrap" />
                                <StackPanel x:Name="ButtonPanel" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,12,0,4">
                                    <c:TouchButton x:Name="Button0" Padding="8" Content="OK" TabIndex="1" />
                                    <c:TouchButton x:Name="Button1" Padding="8" Margin="8,0,0,0" TabIndex="2" Visibility="Collapsed" />
                                    <c:TouchButton x:Name="Button2" Padding="8" Margin="8,0,0,0" TabIndex="3" Visibility="Collapsed" />
                                    <c:TouchButton x:Name="Button3" Padding="8" Margin="8,0,0,0" TabIndex="4" Visibility="Collapsed" />
                                    <c:TouchButton x:Name="Button4" Padding="8" Margin="8,0,0,0" TabIndex="5" Visibility="Collapsed" />
                                </StackPanel>
                            </StackPanel>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:TouchLevel">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:TouchLevel">
                    <Grid x:Name="LayoutRoot">
                        <Grid.Resources>
                            <sys:Int32 x:Key="MaxFavorites">7</sys:Int32>
                            <Style x:Key="NotchStyle" TargetType="Border">
                                <Setter Property="BorderBrush" Value="#617584"/>
                                <Setter Property="BorderThickness" Value="0,1,1,1" />
                            </Style>
                            <Style x:Key="MeterTextStyle" TargetType="TextBlock">
                                <Setter Property="FontSize" Value="13" />
                                <Setter Property="Padding" Value="6,0,4,0" />
                            </Style>
                        </Grid.Resources>
                        <c:TouchField x:Name="TouchField" Label="{TemplateBinding Label}">
                            <Grid Background="#A1ACB7">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="44" />
                                </Grid.ColumnDefinitions>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition x:Name="MeterLeftColumn" Width="25*" />
                                        <ColumnDefinition x:Name="MeterRightColumn" Width="75*" />
                                    </Grid.ColumnDefinitions>
                                    <Rectangle Grid.Column="0" Fill="Yellow" />
                                </Grid>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>
                                    <Border Grid.Column="0" Style="{StaticResource NotchStyle}" BorderThickness="1,1,1,1" />
                                    <Border Grid.Column="1" Style="{StaticResource NotchStyle}" />
                                    <Border Grid.Column="2" Style="{StaticResource NotchStyle}" />
                                    <Border Grid.Column="3" Style="{StaticResource NotchStyle}" />
                                    <Border Grid.Column="4" Style="{StaticResource NotchStyle}" />
                                    <Border Grid.Column="5" Style="{StaticResource NotchStyle}" />
                                    <Border Grid.Column="6" Style="{StaticResource NotchStyle}" />
                                    <Border Grid.Column="7" Style="{StaticResource NotchStyle}" />
                                    <Border Grid.Column="8" Style="{StaticResource NotchStyle}" />
                                    <Border Grid.Column="9" Style="{StaticResource NotchStyle}" />
                                </Grid>
                                <Border Grid.Column="1" Background="White">
                                    <TextBlock x:Name="MeterTextBlock" FontSize="13" TextAlignment="Right" Padding="0,0,2,0"   Text="100%" />
                                </Border>
                            </Grid>
                        </c:TouchField>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:TouchLevelPopup">
        <Setter Property="Background" Value="White" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:TouchLevelPopup">
                    <Canvas x:Name="LayoutRoot" Width="370" Height="110">
                        <Canvas.Resources>
                            <Style x:Key="FavoriteButtonStyle" TargetType="c:TouchButton"/>
                        </Canvas.Resources>
                        <Canvas.Clip>
                            <RectangleGeometry Rect="0,0,9999,9999" />
                        </Canvas.Clip>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="FavoritesPanelStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition From="FavoritesPanelHidden" To="FavoritesPanelVisible">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0:0:0.5" Storyboard.TargetName="FavoritesPanel" Storyboard.TargetProperty="(Canvas.Top)" To="0" />
                                            <DoubleAnimation Duration="0:0:0.5" Storyboard.TargetName="MainPanel" Storyboard.TargetProperty="(Canvas.Top)" To="60" />
                                            <DoubleAnimation Duration="0:0:0.5" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Canvas.Height)" To="110" />
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition From="FavoritesPanelVisible" To="FavoritesPanelHidden">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0:0:0.5" Storyboard.TargetName="FavoritesPanel" Storyboard.TargetProperty="(Canvas.Top)" To="-60" />
                                            <DoubleAnimation Duration="0:0:0.5" Storyboard.TargetName="MainPanel" Storyboard.TargetProperty="(Canvas.Top)" To="0" />
                                            <DoubleAnimation Duration="0:0:0.5" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Canvas.Height)" To="50" />
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition From="FavoritesPanelVisible_UpsideDown" To="FavoritesPanelHidden_UpsideDown">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0:0:0.5" Storyboard.TargetName="MainPanel" Storyboard.TargetProperty="(Canvas.Top)" To="0" />
                                            <DoubleAnimation Duration="0:0:0.5" Storyboard.TargetName="FavoritesPanel" Storyboard.TargetProperty="(Canvas.Top)" To="-10" />
                                            <DoubleAnimation Duration="0:0:0.5" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Canvas.Height)" To="50" />
                                        </Storyboard>
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="FavoritesPanelVisible">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FavoritesPanel" Storyboard.TargetProperty="(Canvas.Top)" To="0" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="MainPanel" Storyboard.TargetProperty="(Canvas.Top)" To="60" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Canvas.Height)" To="110" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="FavoritesPanelHidden">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FavoritesPanel" Storyboard.TargetProperty="(Canvas.Top)" To="-60" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="MainPanel" Storyboard.TargetProperty="(Canvas.Top)" To="0" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Canvas.Height)" To="50" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="FavoritesPanelVisible_UpsideDown">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="MainPanel" Storyboard.TargetProperty="(Canvas.Top)" To="0" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FavoritesPanel" Storyboard.TargetProperty="(Canvas.Top)" To="50" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Canvas.Height)" To="110" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="FavoritesPanelHidden_UpsideDown">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="MainPanel" Storyboard.TargetProperty="(Canvas.Top)" To="0" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FavoritesPanel" Storyboard.TargetProperty="(Canvas.Top)" To="-10" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(Canvas.Height)" To="50" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DeleteFavoritesModeStates">
                                <VisualState x:Name="DeleteFavoritesModeOff" />
                                <VisualState x:Name="DeleteFavoritesModeOn">
                                    <Storyboard>
                                        <!-- this fails for some reason:
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DeleteFavoritesButton" Storyboard.TargetProperty="IsLit">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="False" />
                                        </ObjectAnimationUsingKeyFrames>
                                        -->
                                        <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="DeleteFavoritesModeHelp" Storyboard.TargetProperty="Opacity" To="1" />
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="DeleteFavoritesModeHelp" Storyboard.TargetProperty="IsHitTestVisible">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="True" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Canvas x:Name="FavoritesPanel" Canvas.Top="0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="370" Height="60">
                            <StackPanel x:Name="FavoriteButtonParent" Orientation="Horizontal" Margin="15,5,5,5"/>
                            <TextBlock Text="Favorites" Opacity="0.7" Margin="0,0,0,0" Width="0" HorizontalAlignment="Right" VerticalAlignment="Top">
                            <TextBlock.RenderTransform>
                                <TransformGroup>
                                <RotateTransform Angle="270" />
                                    <TranslateTransform Y="55" />
                                </TransformGroup>
                            </TextBlock.RenderTransform>
                            </TextBlock>
                        </Canvas>
                        <Grid x:Name="MainPanel" Background="{TemplateBinding Background}" Canvas.Top="60" Height="50" HorizontalAlignment="Left" VerticalAlignment="Top">
                            <StackPanel Orientation="Horizontal">
                                <c:TouchButton x:Name="Down5Button" Width="75" IsAutoRepeatEnabled="True">
                                    <c:PageDownIcon />
                                </c:TouchButton>
                                <c:TouchButton x:Name="Up5Button" Width="75" IsAutoRepeatEnabled="True">
                                    <c:PageUpIcon />
                                </c:TouchButton>
                                <c:TouchButton x:Name="Down1Button" Margin="10,0,0,0" IsAutoRepeatEnabled="True">
                                    <c:LineDownIcon />
                                </c:TouchButton>
                                <c:TouchButton x:Name="Up1Button" IsAutoRepeatEnabled="True">
                                    <c:LineUpIcon />
                                </c:TouchButton>
                                <c:TouchButton x:Name="SaveFavoriteButton" Margin="10,0,0,0">
                                    <TextBlock Style="{StaticResource Squeeze2}"><Run Text="Save"/><LineBreak/><Run Text="Fav"/></TextBlock>
                                </c:TouchButton>
                                <c:TouchButton x:Name="DeleteFavoritesButton" IsLit="False" IsEnabled="False">
                                    <TextBlock Style="{StaticResource Squeeze2}"><Run Text="Del"/><LineBreak/><Run Text="Fav"/></TextBlock>
                                </c:TouchButton>
                            </StackPanel>
                            <c:Shadow x:Name="DeleteFavoritesModeHelp" ShadowOverhang="8" ShadowDarkness="3" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,8,0,0" Opacity="0" IsHitTestVisible="False">
                                <Border Background="#FFFFFF80" BorderBrush="Gray" BorderThickness="1">
                                    <TextBlock Margin="20,4,20,1"  Height="60" FontSize="13" LineStackingStrategy="BlockLineHeight" LineHeight="14"><Run Text="Choose favorites to delete"/><LineBreak/><Run Text="Touch here to quit"/></TextBlock>
                                </Border>
                            </c:Shadow>
                        </Grid>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:TouchSlider">
        <Setter Property="Width" Value="54" /> <!-- 4 units of Width is shadow -->
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="IsThumbTabStop" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:TouchSlider">
                    <Grid x:Name="LayoutRoot">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="5" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="4" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="5" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="5" />
                            <RowDefinition Height="4" />
                        </Grid.RowDefinitions>

                        <Ellipse Grid.Row="0" Grid.Column="1" Margin="-2,0,-2,-4" Fill="White" Stroke="#C0C0C0" StrokeThickness="1" />

                        <Ellipse Grid.Row="2" Grid.Column="1" Margin="-2,-4,-2,0" Fill="White" Stroke="#C0C0C0" StrokeThickness="1" />

                        <Rectangle Grid.Row="1" Grid.Column="1" Fill="#A0A0A0" Margin="1,0,1,0"/>
                        <Rectangle Grid.Row="1" Grid.Column="1" Fill="#C0C0C0" Margin="0,3,0,3" Width="1" HorizontalAlignment="Left" />
                        <Rectangle Grid.Row="1" Grid.Column="1" Fill="#FFFFFF" Margin="1,0,0,0" Width="1.5" UseLayoutRounding="False" HorizontalAlignment="Left" />
                        <Rectangle Grid.Row="1" Grid.Column="1" Fill="#808080" Margin="0,0,0,0" Width="1" HorizontalAlignment="Right" />

                        <Ellipse Grid.Row="0" Grid.Column="1" Margin="1,2,-2,-3">
                            <Ellipse.Fill>
                                <LinearGradientBrush>
                                    <GradientStop Offset="0" Color="#C0C0C0" />
                                    <GradientStop Offset="1" Color="#707070" />
                                </LinearGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>

                        <Ellipse Grid.Row="2" Grid.Column="1" Margin="2,-2,-2,0.5" Fill="#808080" />
                        <Ellipse Grid.Row="2" Grid.Column="1" Margin="1,-2.5,-1.5,1">
                            <Ellipse.Fill>
                                <LinearGradientBrush>
                                    <GradientStop Offset="0" Color="#C0C0C0" />
                                    <GradientStop Offset="1" Color="#707070" />
                                </LinearGradientBrush>
                            </Ellipse.Fill>
                        </Ellipse>
                        <c:Shadow x:Name="OuterThumb" Grid.RowSpan="4" Grid.ColumnSpan="4" Margin="0,0,0,0" VerticalAlignment="Top"
                                    ShadowDarkness="8" ShadowDepth="3" ShadowOverhang="4" ShadowUnderhang="2" ShadowCornerRadius="4">
                            <c:TouchSliderThumb x:Name="InnerThumb" HorizontalContentAlignment="Stretch" Width="Auto" Height="50" IsTabStop="{TemplateBinding IsThumbTabStop}">
                                <StackPanel Margin="10,0,10,0">
                                    <StackPanel.Resources>
                                        <LinearGradientBrush x:Key="DarkGroove">
                                            <GradientStop Offset="0" Color="#80000000" />
                                            <GradientStop Offset="1" Color="#30000000" />
                                        </LinearGradientBrush>
                                        <LinearGradientBrush x:Key="LightGroove">
                                            <GradientStop Offset="0" Color="#FFFFFFFF" />
                                            <GradientStop Offset="1" Color="#A0FFFFFF" />
                                        </LinearGradientBrush>
                                    </StackPanel.Resources>
                                    <Rectangle Height="2" Fill="{StaticResource DarkGroove}" />
                                    <Rectangle Height="2" Fill="{StaticResource LightGroove}" />
                                    <Rectangle Height="2" Fill="{StaticResource DarkGroove}" Margin="0,3,0,0" />
                                    <Rectangle Height="2" Fill="{StaticResource LightGroove}" />
                                    <Rectangle Height="2" Fill="{StaticResource DarkGroove}" Margin="0,3,0,0" />
                                    <Rectangle Height="2" Fill="{StaticResource LightGroove}" />
                                    <Rectangle Height="2" Fill="{StaticResource DarkGroove}" Margin="0,3,0,0" />
                                    <Rectangle Height="2" Fill="{StaticResource LightGroove}" />
                                    <Rectangle Height="2" Fill="{StaticResource DarkGroove}" Margin="0,3,0,0" />
                                    <Rectangle Height="2" Fill="{StaticResource LightGroove}" />
                                </StackPanel>
                            </c:TouchSliderThumb>
                        </c:Shadow>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="c:TouchScrollViewer">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="ScrollButtonVisibility" Value="VisibleAlways" />
        <Setter Property="ScrollSliderVisibility" Value="VisibleAlways" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="PageButtonVisibility" Value="Visible" />
        <Setter Property="ViewportMaxWidth" Value="32767" />
        <Setter Property="ViewportMaxHeight" Value="32767" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:TouchScrollViewer">
                    <Grid x:Name="LayoutRoot">
                        <Grid.Resources>
                            <sys:Double x:Key="ScrollMargin">2</sys:Double>
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="Opacity" To="1" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="WaitingStates">
                                <VisualState x:Name="Idle" />
                                <VisualState x:Name="Waiting">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="WaitIcon" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="*" />
							<ColumnDefinition x:Name="ScrollButtonColumn" Width="50" />
							<ColumnDefinition x:Name="ScrollSliderColumn" Width="58" />
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition Height="*" />
							<RowDefinition Height="4" />
						</Grid.RowDefinitions>
						<Border BorderThickness="{TemplateBinding BorderThickness}">
							<Border.BorderBrush>
								<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
									<GradientStop Color="#FFA3AEB9" Offset="0" />
									<GradientStop Color="#FF8399A9" Offset="0.375" />
									<GradientStop Color="#FF718597" Offset="0.375" />
									<GradientStop Color="#FF617584" Offset="1" />
								</LinearGradientBrush>
							</Border.BorderBrush>
							<Grid Background="{TemplateBinding Background}">
								<ContentControl x:Name="ScrollViewerFocusControl" />
								<ScrollViewer x:Name="ScrollViewer" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" BorderThickness="0" Padding="0" MaxWidth="{TemplateBinding ViewportMaxWidth}" MaxHeight="{TemplateBinding ViewportMaxHeight}" IsTabStop="False">
									<ContentPresenter x:Name="ExtentParent" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
								</ScrollViewer>
								<Rectangle x:Name="FocusVisualElement" Stroke="#6DBDD1" StrokeThickness="1" Opacity="0" IsHitTestVisible="False"  />
                                <c:WaitIcon x:Name="WaitIcon" Margin="0,2,2,0" Visibility="Collapsed" />
                            </Grid>
						</Border>
						<Grid Grid.Column="1">
							<Grid.RowDefinitions>
								<RowDefinition Height="50" />
								<RowDefinition Height="*" />
								<RowDefinition Height="*" />
								<RowDefinition Height="50" />
							</Grid.RowDefinitions>
							<c:TouchButton x:Name="LineUpButton" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" IsTabStop="False" IsAutoRepeatEnabled="True">
								<c:LineUpIcon />
							</c:TouchButton>
							<c:TouchButton x:Name="PageUpButton" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" IsTabStop="False" IsAutoRepeatEnabled="True">
								<c:PageUpIcon />
							</c:TouchButton>
							<c:TouchButton x:Name="PageDownButton" Grid.Row="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" IsTabStop="False" IsAutoRepeatEnabled="True">
								<c:PageDownIcon />
							</c:TouchButton>
							<c:TouchButton x:Name="LineDownButton" Grid.Row="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" IsTabStop="False" IsAutoRepeatEnabled="True">
								<c:LineDownIcon />
							</c:TouchButton>
						</Grid>
						<c:TouchSlider x:Name="TouchSlider" Grid.Column="2" Grid.RowSpan="2" HorizontalAlignment="Right" IsThumbTabStop="False"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:TouchListBox">
        <Setter Property="DragZoneVisibility" Value="Visible" />
        <Setter Property="ScrollButtonVisibility" Value="VisibleAlways" />
        <Setter Property="ScrollSliderVisibility" Value="VisibleAlways" />
        <Setter Property="ScrollPeekAmount" Value="10" />
        <Setter Property="ListMargin" Value="10,10,10,10" />
        <Setter Property="ViewportMinWidth" Value="0" />
        <Setter Property="ViewportMinHeight" Value="0" />
        <Setter Property="ViewportMaxWidth" Value="32767" />
        <Setter Property="ViewportMaxHeight" Value="32767" />
        <Setter Property="PageButtonVisibility" Value="Visible" />
        <Setter Property="Background" Value="Beige" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="SuppressFocusDisplay" Value="False" />
        <Setter Property="ItemButtonStyle">
            <Setter.Value>
                <Style TargetType="c:TouchListBoxItem">
                    <Setter Property="Width" Value="140" />
                    <Setter Property="HorizontalContentAlignment" Value="Left" />
                    <Setter Property="IsTabStop" Value="False" />
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <Canvas />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:TouchListBox">
                    <c:TouchListBoxScrollViewer x:Name="LayoutRoot" ViewportMaxWidth="{TemplateBinding ViewportMaxWidth}" ViewportMaxHeight="{TemplateBinding ViewportMaxHeight}" Background="{TemplateBinding Background}" IgnoreItemsPerRow="1" ScrollButtonVisibility="{TemplateBinding ScrollButtonVisibility}" ScrollSliderVisibility="{TemplateBinding ScrollSliderVisibility}" BorderThickness="{TemplateBinding BorderThickness}" PageButtonVisibility="{TemplateBinding PageButtonVisibility}" SuppressFocusDisplay="{TemplateBinding SuppressFocusDisplay}" ScrollPeekAmount="{TemplateBinding ScrollPeekAmount}">
                        <Grid x:Name="Extent" Background="Transparent" MinWidth="{TemplateBinding ViewportMinWidth}" MinHeight="{TemplateBinding ViewportMinHeight}">
                            <Grid.Resources>
                                <!--
                                <Style x:Key="RowStyle" TargetType="StackPanel">
                                    <Setter Property="Orientation" Value="Horizontal" />
                                </Style>
                                -->
                                <Style x:Key="GripBlockStyle" TargetType="c:GripBlock">
                                    <Setter Property="Width" Value="50" />
                                </Style>
                                <!--
                                <Style x:Key="ItemButtonStyle" TargetType="c:TouchButton">
                                    <Setter Property="Width" Value="140" />
                                    <Setter Property="HorizontalContentAlignment" Value="Left" />
                                    <Setter Property="IsTabStop" Value="False" />
                                </Style>
                                -->
                                <!--
                                <Style x:Key="ItemTextStyle" TargetType="TextBlock">
                                    <Setter Property="Width" Value="120" />
                                    <Setter Property="LineHeight" Value="16" />
                                    <Setter Property="LineStackingStrategy" Value="BlockLineHeight" />
                                    <Setter Property="TextWrapping" Value="Wrap" />
                                    <Setter Property="Margin" Value="8,0,8,0" />
                                </Style>
                                -->
                            </Grid.Resources>
                            <Canvas x:Name="GripBlockContainer"/>
                            <Canvas x:Name="RowContainer">
                                <!--
                                <StackPanel Style="{StaticResource RowStyle}">
                                    <c:GripBlock Style="{StaticResource GripBlockStyle}" Label="1" />
                                    <c:TouchButton Style="{StaticResource ItemButtonStyle}">
                                        <TextBlock Style="{StaticResource ItemTextStyle}" Text="10,000 Maniacs" />
                                    </c:TouchButton>
                                    <c:TouchButton Style="{StaticResource ItemButtonStyle}">
                                        <TextBlock Style="{StaticResource ItemTextStyle}" Text="ABBA [Gary]" />
                                    </c:TouchButton>
                                    <c:TouchButton Style="{StaticResource ItemButtonStyle}">
                                        <TextBlock Style="{StaticResource ItemTextStyle}" Text="Air Supply [Gary]" />
                                    </c:TouchButton>
                                </StackPanel>
                                <StackPanel Style="{StaticResource RowStyle}">
                                    <c:GripBlock Style="{StaticResource GripBlockStyle}" Label="B" />
                                    <c:TouchButton Style="{StaticResource ItemButtonStyle}">
                                        <TextBlock Style="{StaticResource ItemTextStyle}" Text="America" />
                                    </c:TouchButton>
                                    <c:TouchButton Style="{StaticResource ItemButtonStyle}">
                                        <TextBlock Style="{StaticResource ItemTextStyle}" Text="Annie Lennox [Gary]" />
                                    </c:TouchButton>
                                    <c:TouchButton Style="{StaticResource ItemButtonStyle}">
                                        <TextBlock Style="{StaticResource ItemTextStyle}" Text="Backstreet Boys [Gary]" />
                                    </c:TouchButton>
                                </StackPanel>
                                -->
                            </Canvas>
                            <ItemsPresenter x:Name="ItemsPresenter" />
                        </Grid>
                    </c:TouchListBoxScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:TouchDropDownList">
        <Setter Property="DragZoneVisibility" Value="Hidden" />
        <Setter Property="ScrollButtonVisibility" Value="CollapseWhenDisabled" /> <!-- CollapseWhenDisabled adds a layout -->
        <Setter Property="ScrollSliderVisibility" Value="CollapseAlways" />
        <Setter Property="ListMargin" Value="0,0,0,0" />
        <Setter Property="ViewportMinWidth" Value="0" />
        <Setter Property="ViewportMinHeight" Value="0" />
        <Setter Property="ViewportMaxWidth" Value="32767" />
        <Setter Property="ViewportMaxHeight" Value="32767" />
        <Setter Property="PageButtonVisibility" Value="Visible" />
        <Setter Property="DropDownBorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:TouchDropDownList">
                    <Grid x:Name="LayoutRoot">
                        <c:TouchField x:Name="TouchField" Label="{TemplateBinding Label}">
							<TextBlock x:Name="ValueTextBlock" FontSize="13" />
                        </c:TouchField>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:TouchDropDownListPopup">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Background" Value="White" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:TouchDropDownListPopup">
                    <Grid x:Name="LayoutRoot">
                        <c:TouchListBox x:Name="TouchListBox" SuppressFocusDisplay="True" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
	<Style TargetType="c:TouchTabStrip">
		<Setter Property="IsTabStop" Value="False" />
		<Setter Property="Height" Value="59" />
		<!-- Blend complains: <Setter Property="LeftGapWidth" Value="10" />-->
		<!-- Blend complains: <Setter Property="RightGapWidth" Value="*" />-->
		<Setter Property="ItemMinWidth" Value="55" />
		<Setter Property="ItemPadding" Value="4,0,4,2" />
		<Setter Property="ItemsPanel">
			<Setter.Value>
				<ItemsPanelTemplate>
					<Grid Height="62" />
				</ItemsPanelTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="DefaultTabTextStyle">
			<Setter.Value>
				<Style TargetType="TextBlock">
					<Setter Property="FontSize" Value="13" />
					<Setter Property="LineStackingStrategy" Value="BlockLineHeight" />
					<Setter Property="LineHeight" Value="16" />
					<Setter Property="TextWrapping" Value="Wrap" />
					<Setter Property="TextAlignment" Value="Center" />
				</Style>
			</Setter.Value>
		</Setter>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="c:TouchTabStrip">
					<Grid x:Name="LayoutRoot">
						<Grid.Resources>
							<sys:Double x:Key="BottomTruncation">4</sys:Double>
							<sys:String x:Key="BeforeSelectedTabButtonMargin">0,9,-1,0</sys:String>
							<sys:String x:Key="SelectedTabButtonMargin">0,0,0,0</sys:String>
							<sys:String x:Key="AfterSelectedTabButtonMargin">-1,9,0,0</sys:String>
							<Style x:Key="TabButtonStyle" TargetType="c:TouchButton"/>
							<Style x:Key="UpperBoundaryStyle" TargetType="Rectangle">
								<Setter Property="Fill" Value="White" />
								<Setter Property="VerticalAlignment" Value="Bottom" />
								<Setter Property="Margin" Value="0,0,0,3" />
							</Style>
							<Style x:Key="LowerBoundaryStyle" TargetType="Rectangle">
								<Setter Property="Height" Value="1" />
								<Setter Property="Fill" Value="#617584" />
								<Setter Property="VerticalAlignment" Value="Bottom" />
								<Setter Property="Margin" Value="0,0,0,3" />
							</Style>
						</Grid.Resources>
						<ItemsPresenter x:Name="ItemsPresenter" />
					</Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

    <Style TargetType="c:ClientStatus">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="DateFormat" Value="ddd M/d" />
        <Setter Property="TimeFormat" Value="h:mm tt" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:ClientStatus">
                    <Grid x:Name="LayoutRoot">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="BusyStates">
                                <VisualState x:Name="Idle" />
                                <VisualState x:Name="Busy">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.5" Storyboard.TargetName="BusyIcon" Storyboard.TargetProperty="Opacity" To="1" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SimulationStates">
                                <VisualState x:Name="NotSimulated" />
                                <VisualState x:Name="Simulated">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:1.5" Storyboard.TargetName="SimulationLabel" Storyboard.TargetProperty="Opacity" To="1" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="24" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <c:WaitIcon2 x:Name="BusyIcon" Grid.Column="0" Margin="0,7,0,0" HorizontalAlignment="Left" Opacity="0">
                            <c:WaitIcon2.RenderTransform>
                                <ScaleTransform ScaleX="1.8" ScaleY="1.8" />
                            </c:WaitIcon2.RenderTransform>
                        </c:WaitIcon2>
                        <TextBlock x:Name="TimeTextBlock" Grid.Row="0" Grid.Column="1" Foreground="{TemplateBinding Foreground}" FontSize="20" TextAlignment="Right" Margin="0,-4,0,0" Text="12:00 AM" />
                        <TextBlock x:Name="DateTextBlock" Grid.Row="1" Grid.Column="1" Foreground="{TemplateBinding Foreground}" FontSize="16" TextAlignment="Right" Margin="0,-4,0,0" Text="Wed 12/31" />
                        <TextBlock x:Name="SimulationLabel" Grid.Row="2" Grid.Column="1" Foreground="Yellow" FontSize="13" TextAlignment="Right" Margin="0,-2,0,0" Text="SIMULATOR" Opacity="0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:LogItem">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:LogItem">
                    <Grid x:Name="LayoutRoot">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <ContentControl Grid.Column="0" Content="{TemplateBinding Icon}" Margin="0,4,0,0" />
                        <TextBlock Grid.Column="1" Text="{TemplateBinding Message}" FontSize="13" TextWrapping="Wrap" LineStackingStrategy="BlockLineHeight" LineHeight="16"  Margin="4,7,0,0"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:HorizontalBanner">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Height" Value="25" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:HorizontalBanner">
                    <Grid>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition Height="*" />
						</Grid.RowDefinitions>
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition Width="*" />
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>
						<Path Grid.Column="0" Fill="Silver" Data="M 0,5 a 5,5 0 0 1 5,-5 l 0,5 l -5,0 " />
						<Rectangle Grid.Column="1" Fill="Silver" />
						<Path Grid.Column="2" Fill="Silver" Data="M 0,0 a 5,5 0 0 1 5,5 l -5,0 l 0,-5 " />
						<Rectangle Grid.Row="1" Grid.ColumnSpan="3" Fill="Silver" />
						<TextBlock Grid.RowSpan="2" Grid.ColumnSpan="3" Margin="0,2,0,0" Text="{TemplateBinding Text}" TextAlignment="Center" FontSize="15" Foreground="White" FontWeight="Bold" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c:VerticalRockerOverlay">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Width" Value="50" />
        <Setter Property="Height" Value="50" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c:VerticalRockerOverlay">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates" >
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Label" Storyboard.TargetProperty="Opacity" To=".5" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border Margin="10,0,10,0" Height="50" CornerRadius="5" Background="#EDEFF1" VerticalAlignment="Center" IsHitTestVisible="False">
                            <TextBlock x:Name="Label" Text="{TemplateBinding Text}" TextWrapping="Wrap" TextAlignment="Center" FontSize="13" LineStackingStrategy="BlockLineHeight" LineHeight="15" IsHitTestVisible="False" VerticalAlignment="Center" />
                        </Border>
                        <!-- lines on left -->
                        <Rectangle Margin="9,0,0,0" Fill="#C0C0C0" Width="1" HorizontalAlignment="Left" />
                        <Rectangle Margin="10,0,0,0" Fill="#FFFFFF" Width="1" HorizontalAlignment="Left" />
                        <!-- lines on right - note that right gap leaves space for lower button's hourglass underneath -->
                        <Rectangle Margin="0,0,10,0" Fill="#FFFFFF" Width="1" HorizontalAlignment="Right" />
                        <Rectangle Margin="0,0,9,0" Fill="#C0C0C0" Width="1" HorizontalAlignment="Right" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>

